from django.db import models
 
class Order(models.Model):
    order_birth_time = models.IntegerField(null=False)
    wechat_id = models.CharField(max_length=255,null=False)
    ticket_type_id = models.IntegerField(null=False)
    price = models.FloatField(null=False)
    count = models.FloatField(null=False)
    sum_price = models.FloatField(null=False)
    order_status = models.IntegerField(default='1')

class Shop(models.Model):
    shop_name = models.CharField(max_length=32,null=False)
    avatar = models.CharField(max_length=255)
    province = models.CharField(max_length=12,default='辽宁')
    city = models.CharField(max_length=12,default='大连')
    area = models.CharField(max_length=12)
    detail_address = models.CharField(max_length=32,null=False)
    html = models.CharField(max_length=512,null=False)
    shop_pic = models.CharField(max_length=255)
    price = models.FloatField(null=False)
    original_price = models.FloatField(null=False)

class TicketType(models.Model):
    effective_time = models.DateField(default='2499-12-31',null=False)
    avatar = models.CharField(max_length=255,null=False)
    ticket_name = models.CharField(max_length=255,null=False)
    shop_id = models.IntegerField(null=False)
    ticket_type = models.CharField(max_length=50,null=False)
    price = models.FloatField(null=False)
    original_price = models.FloatField(null=False)
    comment = models.CharField(max_length=255,null=False)
    fail_bit = models.IntegerField(default='0')

class Ticket(models.Model):
    ticket_num = models.CharField(max_length=6,null=False)
    order_id = models.IntegerField(null=False)
    ticket_birth_time = models.DateField(null=False)
    fail_ticket_time = models.DateField(null=False)
    ticket_type_id = models.IntegerField(null=False)
    real_pay_money = models.CharField(max_length=255,null=False)
    fail_bit = models.IntegerField(default='0')
    back = models.CharField(max_length=255)
